﻿

function DaTe(txtcontrol)
{
    var gMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];

    var ctrldate = document.getElementById(txtcontrol);   
    if(ctrldate.value == "")
    {
        var Date_sch = new Date();
        var Year = Date_sch.getFullYear();
        var Month = Date_sch.getMonth();
        Month = gMonths[Month]
        var Day = Date_sch.getDate();
       
        //Change Day+1 to Day if you want to enable current date selection in the calander.

        var Sch_date  = (Day)+'-'+(Month)+'-'+Year;   
        
        ctrldate.value = Sch_date;
        document.getElementById("hdnDate").value = Sch_date;
      
          
        var Sch_day;
        Sch_day = new Array;
        Sch_day = Sch_date.split("-");
    }
}

